package com.lingx.web.api.impl;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import com.lingx.bean.TokenBean;
import com.lingx.service.MethodService;
import com.lingx.utils.TokenUtils;
import com.lingx.web.api.IApi;
@Component
public class Api8005 extends AbstractApi implements IApi{
	@Resource
	private JdbcTemplate jdbcTemplate;
	@Resource
	private MethodService methodService;
	@Override
	public int getApiCode() {
		return 8005;
	}
	@Override
	public String getApiName() {
		return "刷新TOKEN";
	}
	@Override
	public Map<String, Object> api(Map<String, Object> params) {
		Map<String,Object> ret=IApi.getRetMap(1, "操作成功");
		String token=IApi.getParamString(params, "lingxtoken", "");
		TokenBean tokenBean=TokenUtils.getTokenData(token);
		token=TokenUtils.getToken(tokenBean);
		ret.put("token", token);
		return ret;
	}
}
